<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>爱贝儿医</title>
    <link rel="stylesheet" href="../style/common.css?<?=版本?>">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no"/>

</head>
<style>
    #chat header{height:50px;width:100%;background:#fff;font:110% 微软雅黑;color:#ff7580;position:fixed;top:0px;}
    #chat header a{color:#ff7580;}
    #chat header .news-btn{float:left;line-height: 50px;text-align: center;width:20%;}
    #chat header .chat_name{float:left;line-height: 50px;text-align: center;width:60%;}
    #chat header .fanhui-btn{float:right;line-height: 50px;text-align: center;width:20%;}
    #chat .content{padding-top:55px;}
    #chat .content .chat-item-o{padding:3px;text-align: left;}
    #chat .style1{;height:40px;float:left;}
    #chat .content .chat-item-img{width:40px;height:40px;overflow: hidden;border-radius: 20px;}
    #chat .content .chat-item-img img{width:40px;height:40px;border-radius: 20px;}
    #chat .content .chat-item-contl{margin-left:2%;float:left;width:78%;overflow:hidden;line-height: 1.5;background-color: #fff;border-radius: 12px;padding:3%;word-break:break-all;color:#666;margin-bottom:10px;}
    #chat .content .chat-item-contr .font{float:right;}
    #chat .content .chat-item-m{padding:3px;text-align: right;}
    #chat .style2{height:40px;float:right;}
    #chat .content .chat-item-contr{float:right;width:78%;margin-right:2%;overflow:hidden;line-height: 1.5;padding:3%;word-break:break-all;border-radius: 12px;background-color: #fff;color:#666;margin-bottom:10px;text-align: left;}
    #chat footer{width:100%;height:40px;position:fixed;bottom:20px;}
    #chat footer .input-text{width:80%;height:50px;float:left;}
    #chat footer .input-text input{width:95%;height:50px;border-radius: 5px;background-color: #fff;margin-left:5%;}
    #chat footer .send-btn{width:18%;height:50px;float:right;line-height: 50px;font-size:110%;text-align: center;margin-left:1%;margin-right:1%;color:#fff;background:#ff7580;border-radius: 10px;}
</style>

<?php
/**
 * Created by PhpStorm. User: ADun, Date: 14-10-15 下午10:11
 * Description:
 */
$openId=getCurrentUserOID();

if(empty($openId)) exit('参数错误');

$bm = new CUI数据中心(Page::b病历管理,$openId);
$语音课程详情 = $bm->生成有效链接('Seller17Shipin_Lessons',$_GET['state']);


$语音课程 = $bm->fc查语音课程($_GET['sid']);

?>
<body>
<div id="chat">
    <header>
        <div id="show123" class="news-btn" >历史</div>
        <div class="chat_name">讨论组名字</div>
        <a href=""><div class="fanhui-btn"> 返回></div></a>
        <div  style="position:fixed;width:20%;height:50px;opacity:0;"><input type="button"  id="查询起始值" name="查询起始值" onclick="查看历史()" style="width: 100%; height: 100%" value="1" /></div>
    </header>
    <div class="content" >
        <div class="chat-item-o" id="content">
            <div class="style1"><div class="chat-item-img"><img src="../style/123.jpg" alt=""></div></div>
            <div class="chat-item-contl"><span class="font">jshuoif</span>
                <div class="clear"></div>
            </div>

        </div>
        <footer>
            <div class="input-text"><input type="text"></div>
            <div class="send-btn">发 送</div>
        </footer>
    </div>
</body>
</html>



<script src="../resource/js/jquery-1.11.1.min.js"></script>
<script language="JavaScript">
    function 查看历史(){
        var page = $('#查询起始值').val();
        $.post('agent_manages.php',{'page':page,"课程id":'<?=$_GET['sid']?>','参数':'查看课程历史消息'},function(data){

            json = eval(data);

            str ='';

            for(var i=0; i<json.length; i++)
            {
                if(json[i].result2){
                    str+='<p>'+json[i].result2+'</p>';
                    $('#show123').remove();
                    $('#查询起始值').remove();
                }

                str+='  <div class="style1"><div class="chat-item-img"><img src="'+json[i].头像+'" alt=""></div></div> <div class="chat-item-contl"><span class="font">'+json[i].内容+'</span> <div class="clear"></div> </div> ';

            }

            $(str).prependTo("#content");

            $('#查询起始值').val(page*1 + 1);
            // alert(data);

        });

    }

</script>